{load header}
<!--/H-->

    <!-- 内容区 -->
    <div id="main-content">
        <div id="top-alert" class="fixed alert alert-error" style="display: none;">
            <button class="close fixed" style="margin-top: 4px;">&times;</button>
            <div class="alert-content">这是内容</div>
        </div>
        <div id="main" class="main">
            
            <!-- nav -->
                        <!-- nav -->
            

            
	<div class="main-title">
		<h2>曝光标签管理</h2>
	</div>
	<div class="cf">

		<!-- 高级搜索 -->
		<div class="search-form fr cf">
			<div class="sleft">
				<input type="text" name="q" class="search-input" value="{$keyword}" placeholder="请输入曝光标签名称">
				<a class="sch-btn" href="javascript:;" id="search" url=""><i class="btn-search"></i></a>
			</div>
		</div>
	</div>
	<div class="tab-wrap">
		<ul class="tab-nav nav">
			<li class="current"><a href="{eval echo site_url('community/exptags')}">曝光标签列表</a></li>
			<li><a href="{eval echo site_url('community/exptags_add')}">添加曝光标签</a></li>
		</ul>
		
		<div class="tab-content">
			
			<!-- 数据列表 -->
			<div class="data-table table-striped">
				<table>
					<thead>
						<tr>
						<th>标签ID</th>
						<th>标签名称</th>
						<th>文章引用总量</th>
                                                <th>标签首字母</th>
						<th>字母全拼</th>
                                                <th>热门</th>
                                                <th>推荐</th>
                                                <th>顺序</th>
                                                <th>操作</th>
						</tr>
					</thead>
					<tbody>
						<!--{loop $list $k1 $val}-->
						<tr>
                                                        <td>{$val['id']}</td>
							<td>{$val['name']}</td>
							<td>{$val['use_count']}</td>
                                                        <td>{$val['letter_first']}</td>
                                                        <td>{$val['letter_all']}</td>
                                                        <td>
                                                        <a title="<!--{if ($val['is_hot'])=='0' }-->设为热门<!--{else}-->点击取消<!--{/if}-->" href="{eval echo site_url('community/setexptagstatus').'?id='.$val['id'].'&status='.abs(1-$val['is_hot']).'&type=is_hot&from=wenda'}" class="ajax-get"><!--{if ($val['is_hot'])=='0' }--><span style="color:#ff0000">取消</span><!--{else}-->热门<!--{/if}--></a>
                                                        </td>
                                                        <td>
                                                        <a title="<!--{if ($val['is_recommend'])=='0' }-->点击推荐<!--{else}-->点击取消<!--{/if}-->" href="{eval echo site_url('community/setexptagstatus').'?id='.$val['id'].'&status='.abs(1-$val['is_recommend']).'&type=is_recommend&from=wenda'}" class="ajax-get"><!--{if ($val['is_recommend'])=='0' }--><span style="color:#ff0000">取消</span><!--{else}-->推荐<!--{/if}--></a>
                                                        </td>
                                                        <td>
                                                        <form action="{eval echo site_url('community/exptags_sort')}" method="post">
                                                        <input type="hidden" name="id" value="{$val['id']}">
                                                        <input type="hidden" name="from" value="wenda">
							<input type="text" name="sort" class="text" value="{$val['sort']}" style="width:50px;">
                                                        </form>
                                                        </td>
							<td>
							<a title="编辑" href="{eval echo site_url('community/exptags_edit').'?id='.$val['id']}">编辑</a>
							</td>
						</tr>
						<!--{/loop}-->
					</tbody>
				</table>
				<!-- 分页 -->
				<div class="page">
					<div>
					{$showpage}
					<span class="rows">共 {$Total} 条记录</span>
					</div>
				</div>
			</div>
	
		</div>
	</div>
<script>
    $(function(){
	//搜索功能
	$("#search").click(function(){
            
	var url = $(this).attr('url');
        var query  = $('.search-form').find('input').serialize();
        query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
        query = query.replace(/^&/g,'');

        if( url.indexOf('?')>0 ){
            url += '&' + query;
        }else{
            url += '?' + query;
        }
		window.location.href = url;
	});
	
        	
    //回车自动提交
    $('.search-form').find('input').keyup(function(event){
        if(event.keyCode===13){
            $("#search").click();
        }
    });
    /* 实时更新分类信息 */
    $(".tab-content")
            .on("submit", "form", function(){
                    var self = $(this);
                    $.post(
                            self.attr("action"),
                            self.serialize(),
                            "json"
                    );
                    return false;
            })
            .on("focus","input",function(){
                    $(this).data('param',$(this).closest("form").serialize());

                })
            .on("blur", "input", function(){
                    if($(this).data('param')!=$(this).closest("form").serialize()){
                        $(this).closest("form").submit();
                    }
                });

})
</script>
<!--F-->{load footer}